<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<script type="text/javascript">
   $(function(){
       $.ajax({
           url:"${pageContext.request.contextPath}/User/selectDayCount.do",
           type:"get",
           dataType:"json",
           success:function(data) {

               // 基于准备好的dom，初始化echarts实例
               var myChart = echarts.init(document.getElementById('main3'));
               var option3 = {
                   title : {
                       text: '过去三周用户注册量变化',
                   },
                   tooltip : {
                       trigger: 'axis'
                   },
                   legend: {
                       data:['人数变化']
                   },
                   toolbox: {
                       show : true,
                       feature : {
                           mark : {show: true},
                           dataView : {show: true, readOnly: false},
                           magicType : {show: true, type: ['line', 'bar']},
                           restore : {show: true},
                           saveAsImage : {show: true}
                       }
                   },
                   calculable : true,
                   xAxis : [
                       {
                           type : 'category',
                           boundaryGap : false,
                           data : ['过去三周内','过去两周内','过去一周内']
                       }
                   ],
                   yAxis :{},
                   series : [
                       {
                           name:'注册人数',
                           type:'line',
                           data:[data.three, data.two, data.one],
                           markPoint : {
                               data : [
                                   {type : 'max', name: '最大值'},
                                   {type : 'min', name: '最小值'}
                               ]
                           },
                           markLine : {
                               data : [
                                   {type : 'average', name: '平均值'}
                               ]
                           }
                       }
                   ]
               };
               // 使用刚指定的配置项和数据显示图表。
               myChart.setOption(option3);
           }
       });
   })
</script>
<div id="main3" style="width: 600px;height:400px;"></div>